﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Globalization;

namespace MOMKeLABS.Converters
{
    public class WindowHeaderControlBoxMaximizeButtonConverter : IValueConverter
    {
        public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
        {
            if (((Constants.WindowConstants.WindowState)value) == Constants.WindowConstants.WindowState.Maximized)
            {
                // the window has been maximized return the icon for the maximized state
                return "2";
            }
            else
            {
                return "1";
            }
        }

        /// <summary>
        /// this should never be called because this is a one wya binding, thus the convert back converter 
        /// should throw and exception if it gets called
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException(this.GetType().ToString() + "  has no convert back function");
        }

    }
}
